(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 8.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       157,          7]
NotebookDataLength[     14827,        456]
NotebookOptionsPosition[     13676,        415]
NotebookOutlinePosition[     14055,        431]
CellTagsIndexPosition[     14012,        428]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell[BoxData[
 RowBox[{
  RowBox[{"e", " ", "=", " ", 
   RowBox[{"1", " ", "/", " ", 
    RowBox[{"Tan", "[", 
     RowBox[{"fov", " ", "/", " ", "2"}], "]"}]}]}], "\[IndentingNewLine]"}]],\
 "Input",
 CellChangeTimes->{
  3.528149109852174*^9, 3.5281493426108627`*^9, {3.5281584907359085`*^9, 
   3.528158519068673*^9}}],

Cell[BoxData[
 RowBox[{"Cot", "[", 
  FractionBox["fov", "2"], "]"}]], "Output",
 CellChangeTimes->{{3.5281585036291885`*^9, 3.528158519427473*^9}, 
   3.528158630186242*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"{", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"e", ",", " ", "0", ",", "0", ",", "0"}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{"0", " ", ",", 
      RowBox[{"e", "/", "a"}], " ", ",", "0", ",", "0"}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{"0", ",", "0", " ", ",", 
      RowBox[{
       RowBox[{"-", 
        RowBox[{"(", 
         RowBox[{"f", "+", "n"}], ")"}]}], "/", 
       RowBox[{"(", 
        RowBox[{"f", "-", "n"}], ")"}]}], " ", ",", 
      RowBox[{
       RowBox[{"-", "2"}], "f", "*", 
       RowBox[{"n", "/", 
        RowBox[{"(", 
         RowBox[{"f", "-", "n"}], ")"}]}]}]}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{"0", ",", "0", ",", " ", 
      RowBox[{"-", "1"}], ",", " ", "0"}], "}"}]}], "}"}], 
  "\[IndentingNewLine]"}]], "Input",
 CellChangeTimes->{{3.528158535389957*^9, 3.5281586285326395`*^9}, {
   3.528158715082348*^9, 3.5281587452746735`*^9}, 3.528159913933322*^9}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"Cot", "[", 
      FractionBox["fov", "2"], "]"}], ",", "0", ",", "0", ",", "0"}], "}"}], 
   ",", 
   RowBox[{"{", 
    RowBox[{"0", ",", 
     FractionBox[
      RowBox[{"Cot", "[", 
       FractionBox["fov", "2"], "]"}], "a"], ",", "0", ",", "0"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0", ",", "0", ",", 
     FractionBox[
      RowBox[{
       RowBox[{"-", "f"}], "-", "n"}], 
      RowBox[{"f", "-", "n"}]], ",", 
     RowBox[{"-", 
      FractionBox[
       RowBox[{"2", " ", "f", " ", "n"}], 
       RowBox[{"f", "-", "n"}]]}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0", ",", "0", ",", 
     RowBox[{"-", "1"}], ",", "0"}], "}"}]}], "}"}]], "Output",
 CellChangeTimes->{3.5281599147601233`*^9}]
}, Open  ]],

Cell[BoxData[""], "Input",
 CellChangeTimes->{{3.5281493439992647`*^9, 3.528149344014865*^9}}],

Cell[BoxData[""], "Input",
 CellChangeTimes->{{3.528149110756975*^9, 3.5281491146725817`*^9}, 
   3.528149345200467*^9}],

Cell[BoxData[
 RowBox[{"m", " ", "=", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"1", ",", "2"}], "}"}], ",", " ", 
    RowBox[{"{", 
     RowBox[{"3", ",", " ", "4"}], "}"}]}], "}"}]}]], "Input",
 CellChangeTimes->{{3.528158660217495*^9, 3.528158692025508*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"{", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"1", ",", "2"}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{"3", ",", "4"}], "}"}]}], "}"}], ".", 
  RowBox[{"{", 
   RowBox[{"1", ",", " ", "2"}], "}"}]}]], "Input",
 CellChangeTimes->{{3.528158804594936*^9, 3.528158812443375*^9}, {
  3.5281588522005606`*^9, 3.5281588524657607`*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"5", ",", "11"}], "}"}]], "Output",
 CellChangeTimes->{{3.528158804626938*^9, 3.5281588127865753`*^9}, 
   3.528158853214562*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"m", "[", 
   RowBox[{"[", 
    RowBox[{"1", ",", "2"}], "]"}], "]"}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{"Simplify", "[", 
  RowBox[{"Solve", "[", 
   RowBox[{
    RowBox[{"xs", " ", "\[Equal]", " ", 
     RowBox[{
      RowBox[{"(", 
       RowBox[{
        RowBox[{"xndc", " ", "*", " ", "0.5"}], " ", "+", " ", ".5"}], ")"}], 
      " ", "*", " ", "w"}]}], ",", " ", "xndc"}], "]"}], "]"}]}], "Input",
 CellChangeTimes->{{3.5281493462612686`*^9, 3.528149346276869*^9}, {
  3.5281587003247223`*^9, 3.528158709185538*^9}, {3.5281591366068354`*^9, 
  3.5281591689667926`*^9}, {3.5281622026050005`*^9, 3.528162267412259*^9}, {
  3.52816243404606*^9, 3.528162455990077*^9}}],

Cell[BoxData["2"], "Output",
 CellChangeTimes->{
  3.528162267879286*^9, {3.5281624408279*^9, 3.5281624563176775`*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"{", 
   RowBox[{"xndc", "\[Rule]", 
    RowBox[{
     RowBox[{"-", "1.`"}], "+", 
     FractionBox[
      RowBox[{"2.`", " ", "xs"}], "w"]}]}], "}"}], "}"}]], "Output",
 CellChangeTimes->{
  3.528162267879286*^9, {3.5281624408279*^9, 3.528162456333277*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"p", " ", "=", " ", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{"e", ",", " ", "0", ",", "0", ",", "0"}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{"0", " ", ",", 
      RowBox[{"e", "/", "a"}], " ", ",", "0", ",", "0"}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{"0", ",", "0", " ", ",", 
      RowBox[{
       RowBox[{"-", 
        RowBox[{"(", 
         RowBox[{"f", "+", "n"}], ")"}]}], "/", 
       RowBox[{"(", 
        RowBox[{"f", "-", "n"}], ")"}]}], " ", ",", 
      RowBox[{
       RowBox[{"-", "2"}], "f", "*", 
       RowBox[{"n", "/", 
        RowBox[{"(", 
         RowBox[{"f", "-", "n"}], ")"}]}]}]}], "}"}], ",", 
    RowBox[{"{", 
     RowBox[{"0", ",", "0", ",", " ", 
      RowBox[{"-", "1"}], ",", " ", "0"}], "}"}]}], 
   "}"}]}], "\[IndentingNewLine]", 
 RowBox[{"ip", " ", "=", " ", 
  RowBox[{"Inverse", "[", "p", "]"}]}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"(", 
   RowBox[{"ip", ".", 
    RowBox[{"{", 
     RowBox[{"1", ",", " ", "0", ",", " ", 
      RowBox[{"-", "1"}], ",", " ", "1"}], "}"}]}], ")"}], "[", 
  RowBox[{"[", "4", "]"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Simplify", "[", 
  RowBox[{
   RowBox[{
    RowBox[{"ip", ".", 
     RowBox[{"{", 
      RowBox[{"0", ",", " ", 
       RowBox[{
        RowBox[{"-", "1"}], " ", "+", " ", 
        RowBox[{"2", 
         RowBox[{"y", "/", " ", "h"}]}]}], ",", " ", 
       RowBox[{"-", "1"}], ",", " ", "1"}], "}"}]}], " ", "/", " ", 
    RowBox[{
     RowBox[{"(", 
      RowBox[{"ip", ".", 
       RowBox[{"{", 
        RowBox[{"0", ",", " ", 
         RowBox[{
          RowBox[{"-", "1"}], " ", "+", " ", 
          RowBox[{"2", 
           RowBox[{"y", "/", " ", "h"}]}]}], ",", " ", 
         RowBox[{"-", "1"}], ",", " ", "1"}], "}"}]}], ")"}], "[", 
     RowBox[{"[", "4", "]"}], "]"}]}], " ", "-", " ", 
   RowBox[{
    RowBox[{"ip", ".", 
     RowBox[{"{", 
      RowBox[{"0", ",", 
       RowBox[{"-", "1"}], ",", 
       RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "/", " ", 
    RowBox[{
     RowBox[{"(", 
      RowBox[{"ip", ".", 
       RowBox[{"{", 
        RowBox[{"0", ",", 
         RowBox[{"-", "1"}], ",", " ", 
         RowBox[{"-", "1"}], ",", " ", "1"}], "}"}]}], ")"}], "[", 
     RowBox[{"[", "4", "]"}], "]"}]}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Simplify", "[", 
  RowBox[{
   RowBox[{
    RowBox[{"ip", ".", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{
        RowBox[{"-", "1"}], " ", "+", " ", 
        RowBox[{"2", 
         RowBox[{"x", " ", "/", " ", "w"}]}]}], ",", "0", ",", " ", 
       RowBox[{"-", "1"}], ",", " ", "1"}], "}"}]}], " ", "/", " ", 
    RowBox[{
     RowBox[{"(", 
      RowBox[{"ip", ".", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{
          RowBox[{"-", "1"}], " ", "+", " ", 
          RowBox[{"2", 
           RowBox[{"x", " ", "/", " ", "w"}]}]}], ",", " ", "0", ",", " ", 
         RowBox[{"-", "1"}], ",", " ", "1"}], "}"}]}], ")"}], "[", 
     RowBox[{"[", "4", "]"}], "]"}]}], " ", "-", " ", 
   RowBox[{
    RowBox[{"ip", ".", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"-", "1"}], ",", "0", ",", 
       RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "/", " ", 
    RowBox[{
     RowBox[{"(", 
      RowBox[{"ip", ".", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "1"}], ",", " ", "0", ",", " ", 
         RowBox[{"-", "1"}], ",", " ", "1"}], "}"}]}], ")"}], "[", 
     RowBox[{"[", "4", "]"}], "]"}]}]}], 
  "]"}], "\[IndentingNewLine]"}], "Input",
 CellChangeTimes->{{3.5281587504070826`*^9, 3.528158761607902*^9}, {
  3.5281587950442753`*^9, 3.528158799006682*^9}, {3.528158984577815*^9, 
  3.528159109583637*^9}, {3.528159174848003*^9, 3.5281591760492053`*^9}, {
  3.528159208955314*^9, 3.528159306471323*^9}, {3.528159336646837*^9, 
  3.528159350749262*^9}, {3.5281597092517185`*^9, 3.528159712870925*^9}, {
  3.528159744012834*^9, 3.5281597887749987`*^9}, {3.528160217840415*^9, 
  3.528160222806879*^9}, {3.5281611730076027`*^9, 3.528161245149414*^9}, {
  3.5281613813075643`*^9, 3.5281613843056793`*^9}, {3.5281614700879817`*^9, 
  3.528161530852932*^9}, {3.5281617191257668`*^9, 3.528161755915981*^9}, {
  3.528162109068548*^9, 3.5281621140495396`*^9}, {3.5281623300167027`*^9, 
  3.5281623721697016`*^9}, {3.5281624456392736`*^9, 3.5281624780147142`*^9}, {
  3.5281625117636514`*^9, 3.5281625162544165`*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"Cot", "[", 
      FractionBox["fov", "2"], "]"}], ",", "0", ",", "0", ",", "0"}], "}"}], 
   ",", 
   RowBox[{"{", 
    RowBox[{"0", ",", 
     FractionBox[
      RowBox[{"Cot", "[", 
       FractionBox["fov", "2"], "]"}], "a"], ",", "0", ",", "0"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0", ",", "0", ",", 
     FractionBox[
      RowBox[{
       RowBox[{"-", "f"}], "-", "n"}], 
      RowBox[{"f", "-", "n"}]], ",", 
     RowBox[{"-", 
      FractionBox[
       RowBox[{"2", " ", "f", " ", "n"}], 
       RowBox[{"f", "-", "n"}]]}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0", ",", "0", ",", 
     RowBox[{"-", "1"}], ",", "0"}], "}"}]}], "}"}]], "Output",
 CellChangeTimes->{
  3.5281602231188803`*^9, {3.528161197544134*^9, 3.528161214437052*^9}, 
   3.5281612455424366`*^9, 3.5281613848090916`*^9, 3.5281614774750805`*^9, 
   3.528161532433591*^9, 3.5281617574646387`*^9, 3.528162114702577*^9, {
   3.528162159435172*^9, 3.5281621780040607`*^9}, 3.5281624821998806`*^9, {
   3.5281625169394255`*^9, 3.52816251950074*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{
     RowBox[{"Tan", "[", 
      FractionBox["fov", "2"], "]"}], ",", "0", ",", "0", ",", "0"}], "}"}], 
   ",", 
   RowBox[{"{", 
    RowBox[{"0", ",", 
     RowBox[{"a", " ", 
      RowBox[{"Tan", "[", 
       FractionBox["fov", "2"], "]"}]}], ",", "0", ",", "0"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0", ",", "0", ",", "0", ",", 
     RowBox[{"-", "1"}]}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"0", ",", "0", ",", 
     RowBox[{"-", 
      FractionBox[
       RowBox[{"f", "-", "n"}], 
       RowBox[{"2", " ", "f", " ", "n"}]]}], ",", 
     RowBox[{"-", 
      FractionBox[
       RowBox[{
        RowBox[{"-", "f"}], "-", "n"}], 
       RowBox[{"2", " ", "f", " ", "n"}]]}]}], "}"}]}], "}"}]], "Output",
 CellChangeTimes->{
  3.5281602231188803`*^9, {3.528161197544134*^9, 3.528161214437052*^9}, 
   3.5281612455424366`*^9, 3.5281613848090916`*^9, 3.5281614774750805`*^9, 
   3.528161532433591*^9, 3.5281617574646387`*^9, 3.528162114702577*^9, {
   3.528162159435172*^9, 3.5281621780040607`*^9}, 3.5281624821998806`*^9, {
   3.5281625169394255`*^9, 3.5281625195163403`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"-", 
   FractionBox[
    RowBox[{
     RowBox[{"-", "f"}], "-", "n"}], 
    RowBox[{"2", " ", "f", " ", "n"}]]}], "+", 
  FractionBox[
   RowBox[{"f", "-", "n"}], 
   RowBox[{"2", " ", "f", " ", "n"}]]}]], "Output",
 CellChangeTimes->{
  3.5281602231188803`*^9, {3.528161197544134*^9, 3.528161214437052*^9}, 
   3.5281612455424366`*^9, 3.5281613848090916`*^9, 3.5281614774750805`*^9, 
   3.528161532433591*^9, 3.5281617574646387`*^9, 3.528162114702577*^9, {
   3.528162159435172*^9, 3.5281621780040607`*^9}, 3.5281624821998806`*^9, {
   3.5281625169394255`*^9, 3.5281625195163403`*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"0", ",", 
   FractionBox[
    RowBox[{"2", " ", "a", " ", "n", " ", "y", " ", 
     RowBox[{"Tan", "[", 
      FractionBox["fov", "2"], "]"}]}], "h"], ",", "0", ",", "0"}], 
  "}"}]], "Output",
 CellChangeTimes->{
  3.5281602231188803`*^9, {3.528161197544134*^9, 3.528161214437052*^9}, 
   3.5281612455424366`*^9, 3.5281613848090916`*^9, 3.5281614774750805`*^9, 
   3.528161532433591*^9, 3.5281617574646387`*^9, 3.528162114702577*^9, {
   3.528162159435172*^9, 3.5281621780040607`*^9}, 3.5281624821998806`*^9, {
   3.5281625169394255`*^9, 3.5281625195163403`*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   FractionBox[
    RowBox[{"2", " ", "n", " ", "x", " ", 
     RowBox[{"Tan", "[", 
      FractionBox["fov", "2"], "]"}]}], "w"], ",", "0", ",", "0", ",", "0"}], 
  "}"}]], "Output",
 CellChangeTimes->{
  3.5281602231188803`*^9, {3.528161197544134*^9, 3.528161214437052*^9}, 
   3.5281612455424366`*^9, 3.5281613848090916`*^9, 3.5281614774750805`*^9, 
   3.528161532433591*^9, 3.5281617574646387`*^9, 3.528162114702577*^9, {
   3.528162159435172*^9, 3.5281621780040607`*^9}, 3.5281624821998806`*^9, {
   3.5281625169394255`*^9, 3.5281625195163403`*^9}}]
}, Open  ]]
},
WindowSize->{1904, 945},
WindowMargins->{{0, Automatic}, {Automatic, 0}},
Magnification->1.6000001430511475`,
FrontEndVersion->"8.0 for Microsoft Windows (64-bit) (November 7, 2010)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[579, 22, 322, 9, 75, InheritFromParent],
Cell[904, 33, 174, 4, 66, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[1115, 42, 950, 27, 75, "Input"],
Cell[2068, 71, 797, 26, 76, "Output"]
}, Open  ]],
Cell[2880, 100, 94, 1, 46, InheritFromParent],
Cell[2977, 103, 120, 2, 46, "Input"],
Cell[3100, 107, 279, 8, 46, "Input"],
Cell[CellGroupData[{
Cell[3404, 119, 369, 11, 46, InheritFromParent],
Cell[3776, 132, 168, 4, 45, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[3981, 141, 734, 18, 103, InheritFromParent],
Cell[4718, 161, 119, 2, 45, "Output"],
Cell[4840, 165, 297, 9, 66, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[5174, 179, 4370, 119, 187, "Input"],
Cell[9547, 300, 1121, 31, 76, "Output"],
Cell[10671, 333, 1161, 32, 67, "Output"],
Cell[11835, 367, 621, 15, 67, "Output"],
Cell[12459, 384, 604, 13, 76, "Output"],
Cell[13066, 399, 594, 13, 76, "Output"]
}, Open  ]]
}
]
*)

(* End of internal cache information *)
